2007-05-01 Matthias Clasen <mclasen@redhat.com>
- * gtk/gtkiconcachvalidator.[hc]: Add an icon cache validator.
+ * gtk/gtkfilechooserdefault.c (struct UpdateCurrentFolderData),
+ (update_current_folder_get_info_cb): add a new struct field to clear
+ the file entry after the current folder has been updated.
+
+ (gtk_file_chooser_default_update_current_folder),
+ (change_folder_and_display_error): Add a new function parameter to
+ trigger file entry clearing.
+
+ (edited_idle_create_folder_cb),
+ (file_list_drag_data_received_get_info_cb),
+ (gtk_file_chooser_default_map),
+ (gtk_file_chooser_default_set_current_folder),
+ (switch_to_selected_folder), (save_entry_get_info_cb),
+ (shortcuts_activate_volume_mount_cb), (shortcuts_activate_volume),
+ (shortcuts_activate_get_info_cb), (list_row_activated),
+ (path_bar_clicked): use new function parameter appropriately.
+
+ (gtk_file_chooser_default_should_respond): trigger file entry clearing
+ after the directory is updated instead of clearing it before, this way
+ we avoid reloading the completion model with the soon to be old folder,
+ causing a warning and a glitch in the folder where completion happens.
+ (#379414, Carlos Garnacho)
+
+2007-05-01 Matthias Clasen <mclasen@redhat.com>
+
+ * gtk/gtkiconcachevalidator.[hc]: Add an icon cache validator.
* gtk/updateiconcache.c: Validate the generated cache before
moving it in place. Also add a --validate option to validate
static gboolean gtk_file_chooser_default_update_current_folder (GtkFileChooser *chooser,
const GtkFilePath *path,
gboolean keep_trail,
+ gboolean clear_entry,
GError **error);
static GtkFilePath * gtk_file_chooser_default_get_current_folder (GtkFileChooser *chooser);
static void gtk_file_chooser_default_set_current_name (GtkFileChooser *chooser,
/* Changes folders, displaying an error dialog if this fails */
static gboolean
change_folder_and_display_error (GtkFileChooserDefault *impl,
- const GtkFilePath *path)
+ const GtkFilePath *path,
+ gboolean clear_entry)
{
GError *error;
gboolean result;
path_copy = gtk_file_path_copy (path);
error = NULL;
- result = gtk_file_chooser_default_update_current_folder (GTK_FILE_CHOOSER (impl), path_copy, TRUE, &error);
+ result = gtk_file_chooser_default_update_current_folder (GTK_FILE_CHOOSER (impl), path_copy, TRUE, clear_entry, &error);
if (!result)
error_changing_folder_dialog (impl, path_copy, error);
goto out;
if (!error)
- change_folder_and_display_error (impl, path);
+ change_folder_and_display_error (impl, path, FALSE);
else
error_creating_folder_dialog (impl, path, g_error_copy (error));
data->impl->action == GTK_FILE_CHOOSER_ACTION_SAVE) &&
data->uris[1] == 0 && !error &&
gtk_file_info_get_is_folder (info))
- change_folder_and_display_error (data->impl, data->path);
+ change_folder_and_display_error (data->impl, data->path, FALSE);
else
{
GError *error = NULL;
if (impl->current_folder)
{
pending_select_paths_store_selection (impl);
- change_folder_and_display_error (impl, impl->current_folder);
+ change_folder_and_display_error (impl, impl->current_folder, FALSE);
}
break;
const GtkFilePath *path,
GError **error)
{
- return gtk_file_chooser_default_update_current_folder (chooser, path, FALSE, error);
+ return gtk_file_chooser_default_update_current_folder (chooser, path, FALSE, FALSE, error);
}
GtkFileChooserDefault *impl;
GtkFilePath *path;
gboolean keep_trail;
+ gboolean clear_entry;
GtkFilePath *original_path;
GError *original_error;
};
/* Set the folder on the save entry */
if (impl->location_entry)
- _gtk_file_chooser_entry_set_base_folder (GTK_FILE_CHOOSER_ENTRY (impl->location_entry),
- impl->current_folder);
+ {
+ _gtk_file_chooser_entry_set_base_folder (GTK_FILE_CHOOSER_ENTRY (impl->location_entry),
+ impl->current_folder);
+
+ if (data->clear_entry)
+ _gtk_file_chooser_entry_set_file_part (GTK_FILE_CHOOSER_ENTRY (impl->location_entry), "");
+ }
/* Create a new list model. This is slightly evil; we store the result value
* but perform more actions rather than returning immediately even if it
gtk_file_chooser_default_update_current_folder (GtkFileChooser *chooser,
const GtkFilePath *path,
gboolean keep_trail,
+ gboolean clear_entry,
GError **error)
{
GtkFileChooserDefault *impl = GTK_FILE_CHOOSER_DEFAULT (chooser);
data->impl = impl;
data->path = gtk_file_path_copy (path);
data->keep_trail = keep_trail;
+ data->clear_entry = clear_entry;
impl->reload_state = RELOAD_HAS_FOLDER;
g_assert (closure.path && closure.num_selected == 1);
- change_folder_and_display_error (impl, closure.path);
+ change_folder_and_display_error (impl, closure.path, FALSE);
}
/* Gets the GtkFileInfo for the selected row in the file list; assumes single
else
{
/* This will display an error, which is what we want */
- change_folder_and_display_error (data->impl, data->parent_path);
+ change_folder_and_display_error (data->impl, data->parent_path, FALSE);
}
out:
if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN
|| impl->action == GTK_FILE_CHOOSER_ACTION_SAVE)
{
- _gtk_file_chooser_entry_set_file_part (entry, "");
- change_folder_and_display_error (impl, path);
+ change_folder_and_display_error (impl, path, TRUE);
retval = FALSE;
}
else if (impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER
path = gtk_file_system_volume_get_base_path (impl->file_system, volume);
if (path != NULL)
{
- change_folder_and_display_error (impl, path);
+ change_folder_and_display_error (impl, path, FALSE);
gtk_file_path_free (path);
}
path = gtk_file_system_volume_get_base_path (impl->file_system, volume);
if (path != NULL)
{
- change_folder_and_display_error (impl, path);
+ change_folder_and_display_error (impl, path, FALSE);
gtk_file_path_free (path);
}
}
goto out;
if (!error && gtk_file_info_get_is_folder (info))
- change_folder_and_display_error (data->impl, data->path);
+ change_folder_and_display_error (data->impl, data->path, FALSE);
else
gtk_file_chooser_default_select_path (GTK_FILE_CHOOSER (data->impl), data->path, NULL);
const GtkFilePath *file_path;
file_path = _gtk_file_system_model_get_path (impl->browse_files_model, &child_iter);
- change_folder_and_display_error (impl, file_path);
+ change_folder_and_display_error (impl, file_path, FALSE);
return;
}
if (child_path)
pending_select_paths_add (impl, child_path);
- if (!change_folder_and_display_error (impl, file_path))
+ if (!change_folder_and_display_error (impl, file_path, FALSE))
return;
/* Say we have "/foo/bar/[.baz]" and the user clicks on "bar". We should then